﻿$(document).ready(function () {
    window.lang.run();
    var prodID = $.Jahanutility.getParameterByName("ID");
    SetProductDetail(prodID);

});

function SetProductDetail(prodID) {
   
    $.ajax({
        'type': 'POST',
        'url': '../Services/Admin.svc/GetProduct',
        'data': JSON.stringify({ ID: prodID }),
        'contentType': 'application/json; charset=utf-8',
        'dataType': 'json',
        'async': false,
        'success': function (data) {
            if (data['d'] != null) {
                if (data['d'].length == 0) {
                    $.kish.message.getErrorMessage("15");
                }
                else {
                    $('.proImage_fn').attr('src', data['d'].PhotoPath);
                    $('.proImage_fn').attr('alt', data['d'].EnName);
                    $('a.highslide').attr('href', data['d'].PhotoPath);
                    $('.EnName_fn').text(data['d'].EnName);
                    $('.FaName_fn').text(data['d'].FaName);
                    $('.FaDSC_fn').text(data['d'].FaDSC);
                    $('.EnDSC_fn').text(data['d'].EnDSC);
                    $('.AddLink_fn').text(data['d'].AdditionalLink);
                    $('.AddLink_fn').attr("href", data['d'].AdditionalLink);                   
                                    
                    window.lang.run();
                }

            }
        }
    });
};
